/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

import java.io.Serializable;
import java.util.HashMap;

/**
 *
 * @author jonas & Sam
 */
public class Message implements Serializable {
    public enum MessageType {PING,DUMMY,TS_REQ,TS_ANSWER,
    RRS_REQ,RRS_ANSWER,CLIENT_HELLO,SERVER_HELLO,SERVER_CERT,
    CLIENT_CERT,CLIENT_KEY_EXCHANGE,CONN_OK, ENCRYPTED, PRE_ENCRYPTED};
    private MessageType messageType;
    HashMap<String,Object> data;
    byte[] b_data;
    private int sequence;

    public Message(MessageType messageType, HashMap<String,Object> data) {
        this.messageType = messageType;
        this.data = data;
    }

    public Message(MessageType messageType, byte[] data){
        this.messageType = messageType;
        this.b_data = data;
    }

    public HashMap<String,Object> getData() {
       return data;
    }

    public byte[] getByteData() {
        return b_data;
    }

    public void setData(HashMap<String,Object> data) {
        this.data = data;
    }

    public void setData(byte[] data) {
        this.b_data = data;
    }

    public MessageType getMessageType() {
        return messageType;
    }

    public void setMessageType(MessageType messageType) {
        this.messageType = messageType;
    }
    
    public int getSequence() {
        return sequence;
    }
}
